<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>
 
 
 
<div id="all_privilege_group_list" class="modal_win_for_list">
	
		<table border="0" cellspacing="1" cellpadding="1">
			<tr>
				<td><input id="select_all_privi_groups" type="checkbox" onclick="Ext.milan.pagejs.page_user.selectAll(this.checked)"/>全选</td>
			</tr>
			<c:forEach var="item" items='${pglist}' varStatus="status">
			<tr>
				<td>
					<input type="checkbox" id="${item.pgid }_chk" name="groupIds" value='${item.pgid }' title="${item.groupname }" level="${item.isauth > 0 ? 'true' : 'false'}"/>${item.groupname }
				</td>
			</tr>
			</c:forEach>
		</table>
		<div class="win-btn-panel">
	    	<input type="button" class="btn-short" value="确 定" onclick="Ext.milan.pagejs.page_user.selectPrivilegeGroup()">
		</div>
	<br/>
</div>
<script type="text/javascript"> 
	//选中已选择的复选框
	var selectedPrivilegeGroups = $("selected_privilege_group_list").options;
	if(selectedPrivilegeGroups && selectedPrivilegeGroups.length > 0) {
		for(var i = 0,glen=selectedPrivilegeGroups.length; i < glen; i++) {
			var hiddenValue = selectedPrivilegeGroups[i].value.split("|");
			$(hiddenValue[0]+ "_chk").checked = true;
		}
		
		var checkboxItems = document.getElementsByName("groupIds");
		if(checkboxItems && checkboxItems.length > 0 && selectedPrivilegeGroups.length == checkboxItems.length) {
			$('select_all_privi_groups').checked = true;
		}
	}
</script>
 